FROM python:3.6.4
ENV DEBIAN_FRONTEND=noninteractive
ENV LANG C.UTF-8


RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

RUN  sed -i "s@http://deb.debian.org@http://mirrors.aliyun.com@g" /etc/apt/sources.list && \
     sed -i 's|security.debian.org|mirrors.163.com/debian-security|g' /etc/apt/sources.list && \
     apt-get clean && \
     apt-get update && \
     apt-get install -y libmysqlclient-dev tzdata  \
                        wget \
                        vim \
                        curl \
                        git \
                        npm \
    && apt-get clean \
    && apt-get autoclean \
    && wget https://golang.google.cn/dl/go1.17.1.linux-amd64.tar.gz\
    && mv go1.17.1.linux-amd64.tar.gz /usr/local/ \
    && tar -zxvf /usr/local/go1.17.1.linux-amd64.tar.gz \
    && mv go/ /usr/local/go \
    && ln -s /usr/local/go/bin/go /usr/bin/go \
    && go env -w GOPROXY=https://goproxy.cn,direct \
    && mkdir -p /root/go/src
RUN cd /root/go/src \
    && chmod -R 0777 /root/go/src \
    && git clone https://gitee.com/jjawesomejj/awesome-task \
    && mv /root/go/src/awesome-task /root/go/src/awesomeTask \
    && npm config set registry https://registry.npm.taobao.org \
    && npm install n -g \
    && n lts \
    && npm install -g yarn \
    && yarn config set registry https://registry.npm.taobao.org/ \
    && cd /root/go/src \
    && git clone https://gitee.com/jjawesomejj/awesome-task-web \
    && cd /root/go/src/awesomeTask/ \
    && go get \
    && go build \
    && pwd

CMD ["/bin/bash","run.sh"]